home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / include / php / Zend / zend_extensions.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-20  |  3.9 KB  |  117 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | Zend Engine                                                          |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 0.92 of the Zend license,     |
  8.    | that is bundled with this package in the file LICENSE, and is        | 
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.zend.com/license/0_92.txt.                                |
  11.    | If you did not receive a copy of the Zend license and are unable to  |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@zend.com so we can mail you a copy immediately.              |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Andi Gutmans <andi@zend.com>                                |
  16.    |          Zeev Suraski <zeev@zend.com>                                |
  17.    +----------------------------------------------------------------------+
  18. */
  19.  
  20.  
  21. #ifndef ZEND_EXTENSIONS_H
  22. #define ZEND_EXTENSIONS_H
  23.  
  24. #include "zend_compile.h"
  25.  
  26. #define ZEND_EXTENSION_API_NO    20001120    
  27.  
  28. typedef struct _zend_extension_version_info {
  29.     int zend_extension_api_no;
  30.     char *required_zend_version;
  31.     unsigned char thread_safe;
  32.     unsigned char debug;
  33. } zend_extension_version_info;
  34.  
  35.  
  36. typedef struct _zend_extension zend_extension;
  37.  
  38. /* Typedef's for zend_extension function pointers */
  39. typedef int (*startup_func_t)(zend_extension *extension);
  40. typedef void (*shutdown_func_t)(zend_extension *extension);
  41. typedef void (*activate_func_t)();
  42. typedef void (*deactivate_func_t)();
  43.  
  44. typedef void (*message_handler_func_t)(int message, void *arg);
  45.  
  46. typedef void (*op_array_handler_func_t)(zend_op_array *op_array);
  47.  
  48. typedef void (*statement_handler_func_t)(zend_op_array *op_array);
  49. typedef void (*fcall_begin_handler_func_t)(zend_op_array *op_array);
  50. typedef void (*fcall_end_handler_func_t)(zend_op_array *op_array);
  51.  
  52. typedef void (*op_array_ctor_func_t)(zend_op_array *op_array);
  53. typedef void (*op_array_dtor_func_t)(zend_op_array *op_array);
  54.  
  55. struct _zend_extension {
  56.     char *name;
  57.     char *version;
  58.     char *author;
  59.     char *URL;
  60.     char *copyright;
  61.  
  62.     startup_func_t startup;
  63.     shutdown_func_t shutdown;
  64.     activate_func_t activate;
  65.     deactivate_func_t deactivate;
  66.  
  67.     message_handler_func_t message_handler;
  68.  
  69.     op_array_handler_func_t op_array_handler;
  70.  
  71.     statement_handler_func_t statement_handler;    
  72.     fcall_begin_handler_func_t fcall_begin_handler;
  73.     fcall_end_handler_func_t fcall_end_handler;
  74.  
  75.     op_array_ctor_func_t op_array_ctor;
  76.     op_array_dtor_func_t op_array_dtor;
  77.  
  78.     int (*api_no_check)(int api_no);
  79.     void *reserved2;
  80.     void *reserved3;
  81.     void *reserved4;
  82.     void *reserved5;
  83.     void *reserved6;
  84.     void *reserved7;
  85.     void *reserved8;
  86.  
  87.     DL_HANDLE handle;
  88.     int resource_number;
  89. };
  90.  
  91.  
  92. ZEND_API int zend_get_resource_handle(zend_extension *extension);
  93. ZEND_API void zend_extension_dispatch_message(int message, void *arg);
  94.  
  95. #define ZEND_EXTMSG_NEW_EXTENSION        1
  96.  
  97.  
  98. #define ZEND_EXTENSION()    \
  99.     ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_VERSION, ZTS_V, ZEND_DEBUG }
  100.  
  101. #define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
  102. #define COMPAT_ZEND_EXTENSION_PROPERTIES   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
  103.  
  104.  
  105. ZEND_API extern zend_llist zend_extensions;
  106.  
  107. void zend_extension_dtor(zend_extension *extension);
  108. ZEND_API int zend_load_extension(char *path);
  109. ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
  110. void zend_append_version_info(zend_extension *extension);
  111. int zend_startup_extensions_mechanism(void);
  112. int zend_startup_extensions(void);
  113. void zend_shutdown_extensions(void);
  114. ZEND_API zend_extension *zend_get_extension(char *extension_name);
  115.  
  116. #endif /* ZEND_EXTENSIONS_H */
  117.